<?php

namespace App\Http\Requests\Admin\AdminUser;
use App\Http\Requests\Request;
use Illuminate\Support\Facades\Input;

class UpdateRequest extends Request{
    public function authorize(){
        return true;
    }
    public function rules(){
        return [
            'name' => 'required|alpha_dash',
            'email' => 'required|email',
            'password' => 'confirmed',
        ];
    }

    public function messages(){
        return [
            'name.required' => '用户名称必须',
            'name.alpha_dash' => '用户仅允许字母、数字、破折号（-）以及底线（_）',
            'email.required' => '邮箱必须填写',
            'email.email' => '邮箱非法',
            'password.confirmed'=>'密码和确认密码不一致！',
        ];
    }
}
